/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine - application
// Copyright (c) 2014.  All Rights Reserved
//
// File:		AEPlatformWin32.h
// Author:		Gianluca Belardelli
// Date:		27/07/2013
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEPLATFORMWIN32_H_
#define _AEPLATFORMWIN32_H_

#define AE_PLATFORM_TYPE "WIN32"

#include <mmintrin.h>
#if defined( _MSC_VER) && _MSC_VER >= 1700
	#include <xmmintrin.h>
#endif

#define V_PRECACHE(offset, ptr) _mm_prefetch(((char*)ptr)+offset,_MM_HINT_T1)
#define V_CACHE_LINE_SIZE 128

#include <Windows.h>

typedef HWND AEWINDOWHANDLE;
typedef HANDLE AETHREADHANDLE;
typedef HANDLE AESEMAPHOREHANDLE;
typedef HANDLE AELPSEMAPHOREHANDLE;
typedef HANDLE AEHANDLE;
typedef CRITICAL_SECTION AECRITICALSECTION;

//#include <core/system/io/platform/win32/AEWin32FileSystem.h>
//#include <core/threads/AECriticalSection.h>

//typedef AEWin32FileSystem AENATIVEFILESYSTEM;
//typedef AEWin32FileSystem *LPAENATIVEFILESYSTEM;

typedef __time64_t	AETIMESTRUCT64;

#define AETIMEFUNC		_time64
#define AEGMTIMEFUNC	_gmtime64
#define AELOCALTIMEFUNC	_localtime64

#define INTERLOCKED_CMPXCHG(var, _old, _new) InterlockedCompareExchange( (long*)&var, _new, _old )

#endif
// _AEPLATFORMWIN32_H_
